package everyday;

import org.junit.jupiter.api.Test;

import java.io.File;

/**
 * 文件相关操作
 *
 * @author gaojie
 * @date 2022-03-02
 */
public class FileOperation {

    /**
     * 1.判断文件是否存在
     * 2.找出文件地址的目录
     */
    @Test
    void test() {
        String path = "D:\\lls\\gaojie\\Desktop\\华发文件夹\\临时文件\\本周申请正向保理业务客户台账-20220302115650.xlsx";
        File file = new File(path);
        System.out.println(file.exists());
        System.out.println(path.substring(0, path.lastIndexOf(File.separator)));
    }
}
